import 'package:json_annotation/json_annotation.dart';
import 'package:flutter_module/http/req_model.dart';
import 'package:flutter_module/config/api.dart';


class ShareReqModel extends ReqModel {
  @override
  String urlWithUUID(String uuid) => API.getAllScore+uuid;

  @override
  Map params() => {};

  Future data(String uuid) => getWithUUID(uuid);
}


class share {
  bool success;
  String message;
  int code;
  List<Result> result;
  int timestamp;

  share({this.success, this.message, this.code, this.result, this.timestamp});

  share.fromJson(Map<String, dynamic> json) {
    success = json['success'];
    message = json['message'];
    code = json['code'];
    if (json['result'] != null) {
      result = new List<Result>();
      json['result'].forEach((v) {
        result.add(new Result.fromJson(v));
      });
    }
    timestamp = json['timestamp'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['success'] = this.success;
    data['message'] = this.message;
    data['code'] = this.code;
    if (this.result != null) {
      data['result'] = this.result.map((v) => v.toJson()).toList();
    }
    data['timestamp'] = this.timestamp;
    return data;
  }
}

class Result {
  String myAccount;
  String heAccount;
  String chipid;
  int time;
  int level;
  String id;
  String productName;

  Result(
      {this.myAccount,
        this.heAccount,
        this.chipid,
        this.time,
        this.level,
        this.id,
        this.productName});

  Result.fromJson(Map<String, dynamic> json) {
    myAccount = json['myAccount'];
    heAccount = json['heAccount'];
    chipid = json['chipid'];
    time = json['time'];
    level = json['level'];
    id = json['id'];
    productName = json['productName'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['myAccount'] = this.myAccount;
    data['heAccount'] = this.heAccount;
    data['chipid'] = this.chipid;
    data['time'] = this.time;
    data['level'] = this.level;
    data['id'] = this.id;
    data['productName'] = this.productName;
    return data;
  }
}
